<?php
	$user = $this->controller->getUser();
	
	$vote_info = $this->layout()->vote_info;
	$vote_list = array();
	foreach($vote_info as $thread_id=>$thread){
		$now = time();
		foreach($thread as $phase_id=> $phase){
			if($phase->view_enable==1){
				$vname = $phase->thread_name;
				$vid = $thread_id."_".$phase_id;
				$vote_list[] = array("name"=>$vname, "votephoto_category"=>$phase->votephoto_category, "vid"=>$vid, "thid"=>$thread_id, "pid"=>$phase_id);
			}
		}
		
	}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?echo ($this->layout()->title!="" ? $this->escape($this->layout()->title) : "") ?></title>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="generator" content="">
	<link rel="SHORTCUT ICON" href="<?php echo EVENT_STATIC_SERVER;?>/images/favicon.ico"/>
	<script type="text/javascript">

		var fadeimages=new Array()
		<?php 
		$totalImg = 16;
		for($i=0; $i<$totalImg; $i++){
		?>
		fadeimages[<?php echo $i;?>]=["<?php echo $this->layout()->spath;?>/slide/<?php echo str_pad($i+1, 3, '0', STR_PAD_LEFT);?>.jpg", "", ""]
		<?php
		}
		?>
	</script>
    <!--Import CSS files:-->
    <link href="<?php echo $this->layout()->spath; ?>/css/style_all.css" rel="stylesheet" type="text/css" /> 
    <!--End css files-->
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/swfobject.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/event_cover_comment.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/fadeimage.js"></script>

   <!--[if lt IE 7]>
        <script defer type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/pngfix.js"></script>
        <link href="<?php echo EVENT_STATIC_SERVER;?>/css/ie6fix.css" rel="stylesheet" type="text/css" />
    <![endif]-->        


</head>
<body>
<!--Menu tamtay:-->
<div class="hdrWrap">
  <div class="hdr">
    <div class="clear"> <a href="http://www.tamtay.vn" class="logo" title="Trang chủ tamtay.vn"><img src="<?php echo $this->layout()->spath; ?>/images/spacer.gif" alt="Tamtay.vn" /></a>
      <?php
	  if ($user->uid>0)
	  {
	  ?>      
	  <div class="personal"> <span class="persText">Chào</span> 
	  <div class="persName" onmouseout="document.getElementById('persPlus').style.visibility='hidden'" onmouseover="document.getElementById('persPlus').style.visibility='visible'">
		<div id="persPlus" class="tt_ddmenu">
			  <a href="http://www.tamtay.vn/myprofile/<?php echo $user->uid?>/edit/basic">Thông tin cá nhân</a>
			  <a href="http://www.tamtay.vn/mymessage/inbox">Tin nhắn</a>
		</div>
		<span><a href="http://tamtay.vn/home/<?php echo $user->name?>"><?php echo $user->name?></a></span>
	  </div>
      <a href="<?php echo IDS_LOGOUT_URL;?>" onclick="return confirm('Bạn chắc chắn thoát ra')" class="persOut">Thoát</a> </div>
	  <?php
	  }
	  ?>
      <div class="searchHdr"> 
	  <?
		if (isset($_GET["q"]))
		{
			$q=$_GET["q"];
		}
		else
		{
			$q="";
		}
		?>
    	<div onmouseover="document.getElementById('webPlus').style.visibility='visible'" onmouseout="document.getElementById('webPlus').style.visibility='hidden'" onclick="document.getElementById('webPlus').style.visibility='hidden'" style="float: left;">
			<div style="visibility: hidden;" id="webPlus" class="tt_ddmenu"> 
				<a id="search_cat" href="#" onClick="changeSearhType('all', 'Toàn bộ');">Toàn bộ</a> 
				<a id="search_cat1" name="video" href="#" onClick="changeSearhType('video', 'Video');">Video</a> 
				<a id="search_cat2" name="photo" href="#" onClick="changeSearhType('photo', 'Ảnh');">Ảnh</a> 
				<a id="search_cat3" name="music" href="#" onClick="changeSearhType('music', 'Nhạc');">Nhạc</a> 
				<a id="search_cat4" name="blog" href="#" onClick="changeSearhType('blog', 'Blog');">Blog</a> 
			</div>			
          	<span><a id="selected_cat" class="searchText" href="#">Video</a></span>
        </div>
        	<form action="http://search.tamtay.vn/" method="POST" id="header_search_form">
		        <input type="text" onkeypress="key_press(event)" onclick="check_search_content();" title="Nhập từ khóa cần tìm..." value="<?echo htmlspecialchars($q)?>" id="searchContent" name="q" style="color: rgb(0, 0, 0);"/>
		        <input type="hidden" name="f" value="video" id="search_type" />
		        <input type="submit" id="search" value="" class="searchButton" />
	       </form> 
      </div>
      <div class="clearThis"></div>
    </div>
    <div class="hdrBottom">
      <!--Start: Navigation-->
      <ul class="mainNav">
        <li><a href="http://www.tamtay.vn/home">Nhà&nbsp;tôi</a></li>        
        <li><a href="http://video.tamtay.vn">Video</a></li>
        <li><a href="http://photo.tamtay.vn">Ảnh</a></li>
        <li><a href="http://music.tamtay.vn">Nhạc</a></li>
        <li><a href="http://blog.tamtay.vn">Blog</a></li>
        <li><a href="http://chat.tamtay.vn/chat">Chat</a></li>
        <li><a href="http://chat.tamtay.vn">Tiện&nbsp;ích</a></li>
        <li><a href="http://applications.tamtay.vn">Game</a></li>
        <li onmouseout="document.getElementById('navPlus').style.visibility='hidden'" onmouseover="document.getElementById('navPlus').style.visibility='visible'">
          <div id="navPlus" class="tt_ddmenu">
            <a href="http://www.tamtay.vn/group/forum">Diễn đàn</a>
            <a href="http://www.tamtay.vn/event">Sự kiện</a>
            <a href="http://www.tamtay.vn/group">Nhóm</a>
            <a href="http://www.tamtay.vn/bookmark/home">Link hay</a>
            <a href="http://www.tamtay.vn/network/home">Cộng đồng</a>
          </div>
          <a href="#" class="itemMore">Thêm</a>
        </li>
        <li class="float-right last"><a href="http://www.tamtay.vn/mboard">Hỗ trợ</a></li>
        <?php
		  if ($user->uid <= 0)
		  {
		  ?>
        <li class="float-right"><a href="<?php echo IDS_REGISTER_URL;?>">Đăng ký</a></li>
        <li class="float-right"><a href="<?php echo IDS_LOGIN_URL;?>">Đăng nhập</a></li>
        <?php } ?>
      </ul>
      <!--End: Navigation-->
      <div class="clearThis"></div>
    </div>
  </div>
</div>
<!--End Menu tamtay:-->
<div id="container">
    <!--Header:-->
    <div id="header" class="page-center">
    	<!--Banner:-->
        <div id="banner"></div>
        <!--Menu:-->
        <div id="menu">
        	<ul class="menu-left">
                <li><a href="/event/<?php echo $this->layout()->short_cut;?>" title="Trang chủ">Trang chủ</a>&nbsp;&nbsp;&nbsp;<img style="vertical-align:middle;" src="<?php echo $this->layout()->spath; ?>/images/icons/icon-menu.jpg" /></li>
                <li><a href="/event/<?php echo $this->layout()->short_cut;?>#mark_news" title="Tin tức">Tin tức</a>&nbsp;&nbsp;&nbsp;<img style="vertical-align:middle;" src="<?php echo $this->layout()->spath; ?>/images/icons/icon-menu.jpg" /></li>
                <?php for($i=0; $i<count($vote_list); $i++){
                	$vote = $vote_list[$i];
                	if($vote["votephoto_category"] > 0){
                	?>
                	<li><a href="http://photo.tamtay.vn/category/browse/<?php echo $vote["votephoto_category"];?>" title="Tin tức"><?=$vote["name"];?></a>&nbsp;&nbsp;&nbsp;<img style="vertical-align:middle;" src="<?php echo $this->layout()->spath; ?>/images/icons/icon-menu.jpg" /></li>
                <?php }else {?>
        		<li><a href="/event/<?php echo $this->layout()->short_cut; ?>/votedlist/<?php echo $vote["thid"]."/".$vote["pid"];?>" title="Tin tức"><?=$vote["name"];?></a>&nbsp;&nbsp;&nbsp;<img style="vertical-align:middle;" src="<?php echo $this->layout()->spath; ?>/images/icons/icon-menu.jpg" /></li>
        		<?php 
        			} // End of if
        			} ?>
                <li><a href="/event/<?php echo $this->layout()->short_cut;?>#mark_video" title="Video">Video</a></li>
                <!--<li><a href="#mark_" title="Thể lệ">Thể lệ cuộc thi</a></li>-->
            </ul>
        </div>
    </div>
    <!--End Header:-->
    <div class="clear"></div>   
    <div class="bg-content"> 
        <div class="content-page">
            <?php echo $this->layout()->content;?>
            <div class="clear"></div>
        </div>
    </div>    
    <div class="clear"></div>
</div>
<!--Start: Bottom-->
<div class="footerWrap">
  <div class="footer">
    <div class="footerLink">
    	<a title="Bản tin T" href="http://blog.tamtay.vn/T.Vongtaylonmai/blog">Bản tin T</a> <span>|</span> 
        <a title="Giới thiệu" href="http://www.tamtay.vn/group/detail/164">Giới thiệu</a> <span>|</span> 
        <a title="Điều khoản sử dụng" href="http://www.tamtay.vn/info/13046">Điều khoản sử dụng</a> <span>|</span> 
        <a title="Chính sách riêng tư" href="http://www.tamtay.vn/info/13047">Chính sách riêng tư</a> <span>|</span> 
        <a title="Quảng cáo" href="http://www.tamtay.vn/adv/adv.php">Quảng cáo</a> <span>|</span> 
        <a title="Tuyển dụng" href="http://www.tamtay.vn/info/13045">Tuyển dụng</a> <span>|</span> 
        <a title="Góp ý" href="http://www.tamtay.vn/advice">Góp ý</a> <span>|</span> 
        <a title="Liên hệ" href="http://www.tamtay.vn/info/13044">Liên hệ</a> <span>|</span> 
        <a title="For Investors" href="http://www.tamtay.vn/info/13048">For Investors</a> <span>|</span>
        <a title="For Developers" href="http://developer.tamtay.vn">For Developers</a> <span>|</span>		
        <a title="Đầu trang" href="#">Đầu trang</a>
    </div>
    <div class="copyRight">Giấy phép ICP của Bộ Thông tin và Truyền thông số: 531/GP-CBC | Ghi rõ nguồn &quot;Tamtay.vn&quot; khi bạn phát hành lại thông tin từ website này. </div>
  </div>
</div>
<!--End: Bottom-->
</body>
</html>